<!DOCTYPE html>
<html lang="en" xmlns:ng="http://angularjs.org" id="ng-app" ng-app="Yihu">
<head>
  <meta charset="UTF-8">
  <title>小茶馆</title>
  <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1">
  <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
  <meta http-equiv="Pragma" content="no-cache" />
  <meta http-equiv="Expires" content="0" />
  <link rel="stylesheet" type="text/css" href="libs/bootstrap/dist/css/bootstrap.min.css">
  <link rel='stylesheet' href='libs/font-awesome/css/font-awesome.min.css' />
  <link rel="stylesheet" type="text/css" href="libs/angular-ui-grid/ui-grid.min.css">
  <link rel="stylesheet" type="text/css" href="stylesheets/style.css?2020614" />
  <script src="libs/jquery-legacy/dist/jquery.min.js"></script>
  <script src="libs/laydate-v1.1/laydate/laydate.js" type="text/javascript"></script>
</head>
<body ng-controller="AppController">
  <div id="wrapper">
    <ng-include src="'tpls/topbar.html'"></ng-include>

    <div class="row">
      <div ng-if="currentUser && currentUser.userId" class="crumb" ncy-breadcrumb></div>
      
      <div class="col-xs-12 col-md-12 animated fadeInRight" style="min-height:600px;">
        <div ui-view>
          加载中...
        </div>
      </div>
    </div>
  </div>

  <!-- 模态框（Modal） -->
  <div class="modal fade modalDialog" id="chooseProductModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog" ng-controller="ProductLibCtrl">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×
          </button>
          <h4 class="modal-title">产品库<span ng-if="artworkLibs.totalRecords">({{artworkLibs.totalRecords}}件产品)</span></h4>
        </div>
        <div class="modal-body" style="_height: 350px; max-height: 350px; min-height: 182px; overflow-y: auto;">
          <form action="javascript:return false" class="form-inline pull-right">
            <div class="input-group"><input type="text" class="form-control" ng-model="productLibSearch.name" placeholder="产品名称"><span class="input-group-btn"><button class="btn btn-primary" ng-click="goodsSearch()"><i class="fa fa-search"></i><span class="hidden-xs">搜索</span></button></span></div>
          </form>
          <table class="table table-hover">
            <thead>
              <tr>
                <th></th>
                <th>产品编号</th>
                <th>产品名称</th>
                <th>价格</th>
              </tr>
            </thead>
            <tbody>
              <tr ng-repeat="artwork in artworkLibs.artworks">
                <td ng-if="!multiple"><input type="radio" name="id" value="{{artwork.id}}" ng-checked="artwork.id === choosedProduct.id" ng-click="chooseProduct(artwork)"></td>
                <td ng-if="multiple"><input type="checkbox" name="id" value="{{artwork.id}}" ng-checked="containProduct(artwork)" ng-click="multiSelect(artwork)"></td>
                <td class="productNo">{{artwork.id}}</td>
                <td class="productName">{{artwork.name}}</td>
                <td class="price">{{artwork.price}}</td>
              </tr>
            </tbody>
          </table>
          <span class="productLibPager" ng-show="artworkLibs.totalPages > 1">
            <a href="javascript:void(0)" class="prevPage" ng-show="artworkLibs.currentPage > 1" ng-click="prevPage()">上一页</a>&nbsp;&nbsp;
            <a href="javascript:void(0)" class="nextPage" ng-show="artworkLibs.currentPage < artworkLibs.totalPages" ng-click="nextPage()">下一页</a>
          </span>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="ok()">选定</button>
          <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="discard()">取消</button>
        </div>
      </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
  </div><!-- /.modal -->

  <!-- 模态框（Modal） -->
  <div class="modal fade modalDialog" id="chooseBargainGoods" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog" ng-controller="BargainLibCtrl">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×
          </button>
          <h4 class="modal-title">砍价商品库<span ng-if="barginGoods.totalRecords">({{barginGoods.total}}件商品)</span></h4>
        </div>
        <div class="modal-body" style="_height: 350px; max-height: 350px; min-height: 182px; overflow-y: auto;">
          <form action="javascript:return false" class="form-inline pull-right">
            <div class="input-group"><input type="text" class="form-control" ng-model="productLibSearch.name" placeholder="商品名称"><span class="input-group-btn"><button class="btn btn-primary" ng-click="goodsSearch()"><i class="fa fa-search"></i><span class="hidden-xs">搜索</span></button></span></div>
          </form>
          <table class="table table-hover">
            <thead>
              <tr>
                <th></th>
                <th>商品名称</th>
                <th>商品底价</th>
                <th>库存</th>
                <th>状态</th>
              </tr>
            </thead>
            <tbody>
              <tr ng-repeat="bargain in barginGoods.list">
                <td><input type="checkbox" name="id" value="{{bargain.id}}" ng-checked="containBargain(bargain)" ng-click="multiSelectBargain(bargain)"></td>
                <td class="productName">{{bargain.name}}</td>
                <td class="price">{{bargain.buttomFee}}</td>
                <td class="stock">{{bargain.stock}}</td>
                <td class="status">{{bargain.status | mapFirstpayState}}</td>
              </tr>
            </tbody>
          </table>
          <span class="productLibPager" ng-show="barginGoods.pages > 1">
            <a href="javascript:void(0)" class="prevPage" ng-show="barginGoods.pageNum > 1" ng-click="prevPage()">上一页</a>&nbsp;&nbsp;
            <a href="javascript:void(0)" class="nextPage" ng-show="barginGoods.pageNum < barginGoods.pages" ng-click="nextPage()">下一页</a>
          </span>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="bargainDone()">选定</button>
          <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="cancelBargain()">取消</button>
        </div>
      </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
  </div><!-- /.modal -->

  <script src="libs/bootstrap/dist/js/bootstrap.min.js" type="text/javascript"></script>
  <script src="libs/angular-legacy/angular.js" type="text/javascript"></script>
  <script src="libs/angular-bootstrap/ui-bootstrap-tpls.min.js" type="text/javascript"></script>
  <script src="libs/angular-ui-router/release/angular-ui-router.min.js" type="text/javascript"></script>
  <script src="libs/ocLazyLoad/ocLazyLoad.min.js" type="text/javascript"></script>

  <!-- angular translate dependecies libs -->
  <script src="libs/angular-translate/angular-translate.min.js" type="text/javascript"></script>
  <script src="libs/angular-translate-loader-url/angular-translate-loader-url.min.js" type="text/javascript"></script>
  <script src="libs/angular-cookies.min/angular-cookies.min.js" type="text/javascript"></script>
  <script src="libs/angular-translate-storage-cookie/angular-translate-storage-cookie.min.js" type="text/javascript"></script>
  <script src="libs/angular-resource/angular-resource.min.js" type="text/javascript"></script>
  <script src="libs/angular-ui-grid/ui-grid.js?v=20190305" type="text/javascript"></script>
  <script src="libs/moment/min/moment.min.js" type="text/javascript"></script>
  <script src="libs/ng-file-upload/ng-file-upload-all.min.js" type="text/javascript"></script>
  <script type="text/javascript" src="libs/jquery_lazyload/jquery.lazyload.js"></script>

  <!-- <script src="libs/iNotify/build/iNotify.min.js" type="text/javascript"></script> -->
  <script src="javascripts/app.js?v=2020614" type="text/javascript"></script>
  <script src="javascripts/animations.js" type="text/javascript"></script>
  <script src="javascripts/directives.js?v=2020614" type="text/javascript"></script>
  <script src="javascripts/controllers.js?v=2020614" type="text/javascript"></script>
  <script src="javascripts/filters.js" type="text/javascript"></script>
  <script src="javascripts/services.js?v=2020614" type="text/javascript"></script>
</body>
</html>